//
// Created by Administrator on 2021/9/29.
//

#ifndef MRENDER_FILEUTIL_H
#define MRENDER_FILEUTIL_H
#include <fstream>
#include <sstream>
#include <vector>
#include "../core/MAssert.h"
#include "../core/Log.h"
#include "../utils/StringUtil.h"

class FileUtil {
public:
    /**
     * 读取文件，返回为字符串
     * @param filePath 文件路径
     * @return 字符串
     */
    static std::string readStrFromFile(std::string filePath);

    /**
     * 读取文件中的每一行并返回
     * @param filePath 文件路径
     * @return 每行数据
     */
    static std::vector<std::string> readLineStrFromFile(std::string filePath);

    /**
     * 字符串写入文件
     * @param filePath 文件路径
     * @param content 内容
     * @return 是否写入成功
     */
    static bool writeStrToFile(std::string filePath, std::string content);
};

#endif //MRENDER_FILEUTIL_H